package com.qf.boot2202day02.controller;

import com.qf.boot2202day02.dao.UserDao;
import com.qf.boot2202day02.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@RequestMapping("/hello")
public class HelloController {

    @GetMapping("/test1")
    public String test1(){
        return "hello";
    }


    @GetMapping("/get/{userid}")
    public User getUser(@PathVariable("userid") Integer userid){
        final User user = new User();
        user.setBirthDay(new Date());
        user.setRegistTime(new Date());
        return user;
    }
}
